home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / Samples / Moofwars 1.02 / MoofWars Encoder / •Headers / main.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-24  |  3.6 KB  |  131 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. #    Main.h
  4. #    
  5. #    An extremely basic encoder utility to assist in building all of the various
  6. #   "compiled" resources used by MoofWars.  Many of the encoder utilities are actually
  7. #   handled by things in the standard TGraphic class, so the main reason for pre-encoding
  8. #   the graphics is to improve the time to load the graphics in the game.
  9. #   
  10. #
  11. #    Author: Timothy Carroll
  12. #    Apple Developer Technical Support
  13. #    timc@apple.com
  14. #
  15. #    Modification History: 
  16. #
  17. #    8/15/96        TMC     Initial Release
  18. #
  19. #    2/27/97        TMC        Now load app conditionals and error macros from separate files
  20. #
  21. #    2/27/97        TMC        Conditionally include Metrowerks headers to be more compiler-friendly
  22. #
  23. #    Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  24. #
  25. #
  26. #    You may incorporate this sample code into your applications without
  27. #    restriction, though the sample code has been provided "AS IS" and the
  28. #    responsibility for its operation is 100% yours.  However, what you are
  29. #    not permitted to do is to redistribute the source as "DSC Sample Code"
  30. #    after having made changes. If you're going to re-distribute the source,
  31. #    we require that you make it clear in the source that the code was
  32. #    descended from Apple Sample Code, but that you've made changes.
  33. #
  34. *************************************************************************************/
  35.  
  36. #ifndef _MOOFENCODE_
  37. #define _MOOFENCODE_
  38.  
  39. #pragma once
  40.  
  41. #ifdef __MWERKS__
  42. #include <MacHeadersPPC++>
  43. #endif
  44.  
  45. #include <Quickdraw.h>
  46. #include <QDOffscreen.h>
  47. #include <Palettes.h>
  48. #include <DrawSprocket.h>
  49.  
  50.  
  51. #include "AppConditionals.h"
  52. #include "Error Macros.h"
  53.  
  54.  
  55.     
  56.  
  57. /*********************************************************************************
  58.     OTHER NECESSARY HEADERS    
  59. *********************************************************************************/
  60. #include "Scaling.h"
  61. #include "TGraphicCollection.h"
  62.  
  63.  
  64. /*********************************************************************************
  65.     CONSTANTS    
  66. *********************************************************************************/
  67.  
  68.  
  69. // A few standard colors -- probably should use palette calls instead!
  70. const RGBColor kWhite = {0xFFFF, 0xFFFF, 0xFFFF};
  71. const RGBColor kBlack = {0x0000, 0x0000, 0x0000};
  72. const RGBColor kDarkBlue = {0x0000,0x0000,0x7000};
  73. const RGBColor kLtGrey = {0xC000,0xC000,0xC000};
  74. const RGBColor kMediumGrey = {0x7FFF,0x7FFF,0x7FFF};
  75.  
  76. // The ResID of the application's color table.  All of my custom graphics routines use
  77. // an 8-bit color table and the sprite is encoded to use these colors.  The actual variable
  78. // to hold the color table is declared below.
  79.  
  80. enum {
  81.     kAppColorTableResID = 128
  82. };
  83.  
  84. // Various constants used to load the background tile and sprite graphics.
  85.  
  86. enum {
  87.     kGridResourceID = 500
  88. };
  89.  
  90. enum {
  91.     kPreferredDepth = 8
  92. };
  93.  
  94. // We'll use these contants to tailor the Application's behavior.
  95. enum {
  96.     kEventInterval = 3,
  97.     kNumberOfMasters = 10,
  98.     kSleepTime = 0
  99. };
  100.  
  101. // Constants for all the menu functions
  102. enum
  103. {
  104.     rMenuBar = 128,
  105.     mAppleMenu = 128,
  106.         iAboutApp = 1,
  107.     mFileMenu = 129,
  108.         iEncodeIcons = 1,
  109.         iEncodePICTs = 2,
  110.         iTriplePICTs = 4,
  111.         iEncodeTiles = 5,
  112.         iQuit = 7
  113. };
  114.  
  115. /*********************************************************************************
  116.     Globals    
  117. *********************************************************************************/
  118.  
  119. // The main color table described above
  120. extern CTabHandle            gAppColorTable;
  121.  
  122.  
  123. /*********************************************************************************
  124.     Functions    
  125. *********************************************************************************/
  126.  
  127. OSStatus CopyResource (SInt16 inRes, SInt16 outRes, OSType theType, SInt16 theID);
  128.  
  129. #endif /* _MOOFENCODE_ */
  130.  
  131.